package com.yantu.controller.student;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yantu.bean.User;
import com.yantu.mapper.UserMapper;
import com.yantu.util.Result;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@ApiModel("修改用户信息接口")
public class StudentUserUpdateController {

    @Autowired
    UserMapper userMapper;

    @PutMapping("/userCurrent/")
    @ApiOperation("当前用户信息")
    public Result userCurrent(@RequestBody User user) {

        QueryWrapper<User > queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",user.getId());
        userMapper.update(user,queryWrapper);


        return Result.succ(200,"修改成功",null);
    }
}
